﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="PageReportContract.aspx.cs" Inherits="ContractManagementSystem.PageReportContract" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PanelContent" runat="server">
    <div class="divWrap">
        <h2 class="divTitle">
                List Contract</h2>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Panel runat="server" ID="ViewPanel">
                    <fieldset style="width: 98%; margin: auto; padding-left: 7px;padding-bottom: 10px;" class="border">
                        <legend><b>Search</b></legend>
                        <table style="width: 100%">
                            <tr>
                                <td style="width: 700px;">
                                    <asp:TextBox runat="server" ID="ContractorNameTextBox" placeholder="Contractor 's name"
                                        ToolTip="Contractor 's name" ></asp:TextBox>
                                    <asp:Button runat="server" ID="SearchButton" Text="Search" 
                                    ToolTip="Search" OnClick="SearchButton_OnClick"/>
                                </td>
                                <td style="width: 100px;">
                                    ContractType
                                </td>
                                
                                <td style="text-align: right;padding-right: 10px;">
                                    <asp:DropDownList runat="server" ID="ContractTypeViewDropDownList" AutoPostBack="true"
                                    OnSelectedIndexChanged="ContractTypeViewDropDownList_OnSelectedIndexChanged"/>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                    <asp:Panel ID="EditPanel" runat="server">
                    </asp:Panel>
                    <asp:ListView ID="ContractListView" runat="server" ItemPlaceholderID="NewItem">
                        <LayoutTemplate>
                            <table id="table">
                                <tr>
                                    <th>
                                        <asp:LinkButton runat="server" ToolTip="Sort" CommandName="Sort" CommandArgument="Contractor"
                                            ID="LinkButton6">Contractor</asp:LinkButton>
                                        <asp:Image runat="server" ID="SortContractor" ImageUrl="App_Themes/Admin/Image/down.png" />
                                    </th>
                                    <th>
                                        <asp:LinkButton runat="server" ToolTip="Sort" CommandName="Sort" CommandArgument="ContractType"
                                            ID="LinkButton7">ContractType</asp:LinkButton>
                                        <asp:Image runat="server" ID="SortContractType" ImageUrl="App_Themes/Admin/Image/down.png" />
                                    </th>
                                    <th>
                                        <asp:LinkButton runat="server" ToolTip="Sort" CommandName="Sort" CommandArgument="Manager"
                                            ID="LinkButton8">Manager</asp:LinkButton>
                                        <asp:Image runat="server" ID="SortManager" ImageUrl="App_Themes/Admin/Image/down.png" />
                                    </th>
                                    <th>
                                        <asp:LinkButton runat="server" ToolTip="Sort" CommandName="Sort" CommandArgument="Consultant"
                                            ID="LinkButton9">Consultant</asp:LinkButton>
                                        <asp:Image runat="server" ID="SortConsultant" ImageUrl="App_Themes/Admin/Image/down.png" />
                                    </th>
                                    <th>
                                        <asp:LinkButton runat="server" ToolTip="Sort" CommandName="Sort" CommandArgument="StartDate"
                                            ID="LinkButton10">StartDate</asp:LinkButton>
                                        <asp:Image runat="server" ID="SortStartDate" ImageUrl="App_Themes/Admin/Image/down.png" />
                                    </th>
                                    <th>
                                        <asp:LinkButton runat="server" ToolTip="Sort" CommandName="Sort" CommandArgument="EndDate"
                                            ID="LinkButton11">EndDate</asp:LinkButton>
                                        <asp:Image runat="server" ID="SortEndDate" ImageUrl="App_Themes/Admin/Image/down.png" />
                                    </th>
                                    
                                </tr>
                                <tr>
                                    <asp:PlaceHolder runat="server" ID="NewItem"></asp:PlaceHolder>
                                </tr>
                            </table>
                        </LayoutTemplate>
                        <EmptyDataTemplate>
                            <h4 class="empty">
                                There are no items to show in this view.</h4>
                        </EmptyDataTemplate>
                        <ItemTemplate>
                            <tr class="odd">
                                <td style="text-align: left; padding-left: 10px;">
                                    <%#Eval("ContractorName")%>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <%#Eval("ContractTypeName")%>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <%#Eval("ManagerName")%>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <%#Eval("ConsultantName")%>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <asp:Label runat="server" ID="StartDateLabel" Text='<%#Eval("StartDate","{0:d}")%>' />
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <asp:Label runat="server" ID="EndDateLabel" Text='<%#Eval("EndDate","{0:d}")%>' />
                                </td>
                                <td>
   
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr class="alt">
                                <td style="text-align: left; padding-left: 10px;">
                                    <%#Eval("ContractorName")%>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <%#Eval("ContractTypeName")%>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <%#Eval("ManagerName")%>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <%#Eval("ConsultantName")%>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <asp:Label runat="server" ID="StartDateOddLabel" Text='<%#Eval("StartDate","{0:d}")%>' />
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <asp:Label runat="server" ID="EndDateOddLabel" Text='<%#Eval("EndDate","{0:d}")%>' />
                                </td>
                                <td>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                    </asp:ListView>
                     <div style="text-align: center">
                       <asp:Button ID="ReportButton" runat="server" Height="25px" Text="Report" 
                       Width="76px" onclick="ReportButton_Click" />
                     </div>
                   
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
